package com.example.restatr.Atcivity.Park;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;

import com.example.restatr.R;
import com.example.restatr.Tools;

public class ParkInfoAt extends AppCompatActivity {
    private Toolbar tb;
    private TextView barTitle;
    private EditText search;
    private TextView name;
    private TextView phone;
    private TextView address;
    private TextView Class;
    private TextView money;
    private TextView area;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView( R.layout.activity_tcc_xq_at);

        tb = findViewById(R.id.toolbar);
        barTitle = findViewById(R.id.bar_Title);
        search = findViewById(R.id.search);
        name = findViewById(R.id.name);
        phone = findViewById(R.id.phone);
        address = findViewById(R.id.address);
        Class = findViewById(R.id.Class);
        money = findViewById(R.id.money);
        area = findViewById(R.id.area);
        Tools.SetBarTitle( tb,barTitle,"停车场详情",search, ParkInfoAt.this,false );
        Intent intent = getIntent();
        name.setText(intent.getStringExtra("parkName"));
        money.setText(intent.getStringExtra("rates") + "/小时  " + intent.getStringExtra("priceCaps") + "/天");
        address.setText(intent.getStringExtra("address"));
        Class.setText(intent.getStringExtra("distance") + "m");
        phone.setText(intent.getStringExtra( "open" ));
        if (intent.getStringExtra("open").equals("对外开放")){
            phone.setTextColor(0xff4CAF50);
        }else {
            phone.setTextColor(0xffFFC107);
        }
        area.setText(intent.getStringExtra("vacancy") + "/" + intent.getStringExtra("allPark"));
    }
}